#include<iostream>
#include<algorithm>
#include<iomanip>
using namespace std;
int main(){
    int n;
    while (cin>>n&&n>2&&n<=100)
    {
        int a[100];
        double avg,sum=0;
        for(int i=0;i<n;i++){
            cin>>a[i];
        }
        sort(a,a+n);
        for(int i=1;i<n-1;i++){
            sum+=a[i];
        }
        avg=sum/(n-2);
        cout<<fixed<<setprecision(2)<<avg<<endl;
    }
    
}